/*
 *  File Information
 *
 *  Last Modified On: $Date: 2007-06-13 20:35:36 +0000 (Wed, 13 Jun 2007) $
 *  Last Modified By: $Author: mihai.balan $
 */

package ro.pub.cs.stadium.document.logic;

import ro.pub.cs.stadium.document.*;

public class Variable {
	String name;
	private boolean out;
	
	public Variable(String name) {
		this.name = name;
	}
	
	public Variable(String name,boolean type) {
		this(name);
		out = type;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String s) {
		this.name = s;
	}
	
	public String toString() {
		String s = "name="+name + ", type=";
		if (out)
			s+="out";
		else
			s+="in";
		return s+"\n";
	}
	
	public void setType (boolean isOut) {
		this.out = isOut; 
	}
	
	public boolean getType () {
		return out;
	}
	
	public boolean equals(Object var) {
		if (!(var instanceof Variable))
			return false;
		
		return name.equals(((Variable)var).name);
	}
	
	public boolean isOut() {
		return out;
	}
	
}
